package com.rybbaby.tss.platform.sysRoleJoinSysMenuPermissions.service.imp;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

import com.rybbaby.tss.core.web.service.imp.BaseServiceImp;
import com.rybbaby.tss.platform.sysHandlePermissions.service.ISysHandlePermissionsService;
import com.rybbaby.tss.platform.sysRoleJoinSysMenuPermissions.entity.SysRoleJoinSysMenuPermissions;
import com.rybbaby.tss.platform.sysRoleJoinSysMenuPermissions.service.ISysRoleJoinSysMenuPermissionsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * @author 谢进伟
 * @description 权限所属角色数据库操作服务实现
 * @createDate 2016-08-19 上午11:36:25
 */
@Service
@Transactional
public class SysRoleJoinSysMenuPermissionsServiceImp extends BaseServiceImp<SysRoleJoinSysMenuPermissions> implements ISysRoleJoinSysMenuPermissionsService {

	@Autowired
	private ISysHandlePermissionsService sysHandlePermissionsService;

	@Override
	public List<Map<String, Object>> roleIdDatasource() {
		String sql1 = "SELECT id,rolename FROM sys_role";
		List<Map<String, Object>> roleId_datasources = this.findForJdbc(sql1, null);
		return roleId_datasources;
	}

	@Override
	public List<Map<String, Object>> menuPermissionsIdDatasource() {
		String sql2 = "SELECT id,name FROM sys_menu_permissions";
		List<Map<String, Object>> menuPermissionsId_datasources = this.findForJdbc(sql2, null);
		return menuPermissionsId_datasources;
	}

	@Override
	public Serializable save(SysRoleJoinSysMenuPermissions entity) {
		Serializable newId = super.save(entity);
		return newId;
	}

}
